home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CyberMycha 2003 May
/
cmycha200305.iso
/
MutantStorm
/
setup_mutantstorm_demo.exe
/
{app}
/
script
/
actor.lua
< prev
next >
Wrap
Text File
|
2002-09-07
|
6KB
|
255 lines
-- leave me
-- cur_level_num = 0
-- frame counter
ticker = 0
actor_unique_id = 1
setter = 0
function fool( a, b, c )
if setter == 0 then
setglobal( b, c )
else
write( b, " ", a, "\n")
end
end
dofile("actor_table.lua")
exp_no_align = 0
exp_align = 1
health_chunk_regain = 1
health_damagable = 2
health_damagable_check_parent = 3
health_no_damage_check_parent_and_drop = 4
_ACTOR = {}
function _ACTOR:setposn( x, y, z )
self[ci_posn_x] = x
self[ci_posn_y] = y
self[ci_posn_z] = z
end
function _ACTOR:setanimdelay( anim_delay )
self[ci_anim_delay] = anim_delay
end
function _ACTOR:setall( x, y, z, angle, size, hueshift, launch_delay, path_name )
self[ci_posn_x] = x
self[ci_posn_y] = y
self[ci_posn_z] = z
self[ci_angle] = angle
self[ci_model_size] = size
self[ci_hue_shift] = hueshift
self[ci_launch_delay] = launch_delay
if path_name ~= nil then
self[ci_path_name] = path_name
end
end
function _ACTOR:launch()
c_launch_new_actor( self )
end
function ACTOR_PreLaunch( actor_code, unique_name )
local n = {}
actor_unique_id = actor_unique_id + 1
n[ci_actor_name] = actor_code
if unique_name == nil then
n[ci_unique_name] = ""
else
n[ci_unique_name] = unique_name
end
n[ci_path_name] = ""
n[ci_model_size] = 0.0
n[ci_posn_x] = 0.0
n[ci_posn_y] = 0.0
n[ci_posn_z] = 0.0
n[ci_angle] = 0.0
n[ci_anim_delay] = 0.0
n[ci_hue_shift] = 0.0
n[ci_launch_delay] = 0.0
n.setposn = _ACTOR.setposn
n.setanimdelay = _ACTOR.setanimdelay
n.setall = _ACTOR.setall
n.launch = _ACTOR.launch
return n
end
function ACTOR_preload()
local actor = {}
c_change_bitmap( "", "" )
-- use as template
actor[cp_actor_name] = ""
actor[cp_model_dir] = ""
actor[cp_model_name] = ""
actor[cp_actor_type] = cat_beastie
actor[cp_hit_delay] = 0.01
actor[cp_mutate_hit_delay] = 0.01
actor[cp_move_type] = 0
actor[cp_weight] = 0.0
actor[cp_hit_power] = 0.0
actor[cp_i_collide_with_beasties] = cat_player
actor[cp_these_collide_with_me] = cat_player + cat_bullet
actor[cp_i_avoid_these_beasties] = 0
actor[cp_in_beastie_count] = 1
actor[cp_in_screen_zoom_box] = 0
-- movement
actor[cp_move_speed_min] = 0.0
actor[cp_move_speed_max] = 0.0
actor[cp_move_acceleration] = 0.0
actor[cp_move_deceleration] = 0.0
actor[cp_move_inertia_accn] = 0.0
actor[cp_move_inertia_decn] = 0.0
actor[cp_burst_length_min] = 0.0
actor[cp_burst_length_max] = 0.0
actor[cp_burst_delay_min] = 0.0
actor[cp_burst_delay_max] = 0.0
actor[cp_look_ahead_dist] = 0.0
actor[cp_repel_dist] = 0.0
actor[cp_target_stop_dist] = 0.0
actor[cp_target_delay_min] = 0.01
actor[cp_target_delay_max] = 0.05
actor[cp_turn_lock_angle_inner] = 360.0
actor[cp_turn_lock_angle_outer] = 360.0
actor[cp_turn_speed_still] = 0.0
actor[cp_turn_acceleration_still] = 0.0
actor[cp_turn_inertia_still] = 0.0
actor[cp_turn_speed_moving] = 0.0
actor[cp_turn_acceleration_moving] = 0.0
actor[cp_turn_inertia_moving] = 0.0
actor[cp_turn_speed_aiming] = 0.0
actor[cp_health_regain] = 0.0
actor[cp_health_percent] = 100.0
actor[cp_health_type] = 0.0
actor[cp_health_byebye_percent] = 0.0
actor[cp_launch_scale_min] = 100.0
actor[cp_launch_scale_max] = 100.0
actor[cp_launch_hue_shift] = 0.0
actor[cp_bullet_spray_angle] = 0.0
actor[cp_blank] = 1.0
actor[cp_player_bullet_rate] = 0.1
actor[cp_random_offset_x] = 0.0
actor[cp_random_offset_z] = 0.0
actor[cp_random_trajectory_offset] = 0.0
actor[cp_random_trajectory_offset_delay_min] = 0.0
actor[cp_random_trajectory_offset_delay_max] = 0.0
actor[cp_random_edge_inner_percent] = 0.0
actor[cp_random_edge_outer_percent] = 90.0
actor[cp_fence_bounce_percent] = 50.0
actor[cp_max_explosion_multiply] = 0.0
actor[cp_rolly_polly_multiply] = 0.0
actor[cp_angle_grid_size] = 0.0
actor[cp_num_spawn_min] = 1.0
actor[cp_num_spawn_max] = 1.0
actor[cp_scale_spawn_min] = 100.0
actor[cp_scale_spawn_max] = 100.0
actor[cp_score] = 0
actor[cp_bonus_seq_hit] = 0
actor[cp_bonus_seq_score] = 0
actor[cp_level_end_score] = 0
actor[cp_geopus_style] = 0
actor[cp_fade_in_translucent] = 0
actor[cp_multiple_beast_shoot_rate] = 0.0
actor[cp_multiple_beast_base_num] = 0.0
actor[cp_difficulty_adjust_speed] = 100.0
actor[cp_difficulty_adjust_shoot] = 100.0
-- actor[cp_delay_at_path_point_min] = 0.0
-- actor[cp_delay_at_path_point_max] = 0.0
actor[cp_spin_speed_min] = 0.0
actor[cp_spin_speed_max] = 0.0
actor[cp_i_am_repelled_by] = 0
actor[cp_move_target] = "track_player"
-- actor[cp_repel_target] = ""
-- use as template
return actor
end
w_gun_type = 2
w_gun_bone_name = 3
w_shaft_bone_name = 4
w_fire_anim_name = 5
w_aim_anim_name = 6
w_flare_exp_name = 7
w_flare_exp_scale = 8
w_aim_delay = 9
w_bullet_scale = 10
w_barrel_offset = 11
w_no_shoot_dist = 12
w_no_shoot_angle = 13
w_recoil_angle = 14
w_recoil_dist = 15
w_reload_random = 16
function WEAPON_preload( actor_code )
local n = {}
n[ci_actor_name] = actor_code
n[w_gun_type] = "no_bone_aim"
n[w_gun_bone_name] = ""
n[w_shaft_bone_name] = ""
n[w_fire_anim_name] = ""
n[w_aim_anim_name] = ""
n[w_flare_exp_name] = ""
n[w_flare_exp_scale] = 100.0
n[w_aim_delay] = 1.0
n[w_bullet_scale] = 100.0
n[w_barrel_offset] = 0.0
n[w_no_shoot_dist] = 9.0
n[w_no_shoot_angle] = 0.0
n[w_recoil_angle] = 0.0
n[w_recoil_dist] = 0.0
n[w_reload_random] = 0.0
return n
end
function WEAPON_add( n, seq )
c_add_a_weapon( n[1], n[2], n[3], n[4], n[5], n[6], n[7], n[8], n[9], n[10], n[11], n[12], n[13], n[14], n[15], n[16], seq )
end
function dofile_lua( filename )
local isloaded = c_is_model_preloaded( filename )
-- c_print( filename, isloaded )
if isloaded ~= 0 then
local filename_lua = format( "%s.lua", filename )
dofile( filename_lua )
end
end
-- leave me